From bb37cf2c8cf1273166a7b069ab886b9440ddb8dc Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 5 Nov 2002 06:13:28 +0000 Subject: [PATCH] Add find waypt by name. --- gpsbabel/waypt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gpsbabel/waypt.c b/gpsbabel/waypt.c index ea477ab53..678297847 100644 --- a/gpsbabel/waypt.c +++ b/gpsbabel/waypt.c @@ -77,3 +77,19 @@ waypt_disp_all(waypt_cb cb) (*cb) (waypointp); } } + +waypoint * +find_waypt_by_name(const char *name) +{ + queue *elem, *tmp; + waypoint *waypointp; + + QUEUE_FOR_EACH(&waypt_head, elem, tmp) { + waypointp = (waypoint *) elem; + if (0 == strcmp(waypointp->shortname, name)) { + return waypointp; + } + } + + return NULL; +} -- 2.30.2